<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class MY_Model extends CI_Model {

	public function __construct() {
		parent::__construct();
	}

	function add_data($table = '', $set = NULL, $default = false, $escape = NULL) {
		$default_fields = array();
		if ($default) {
			$default_fields = array(
				'create_at' => date('Y-m-d H:i:s')
			);
		}

		$data = array_merge($set, $default_fields);
		$result = $this->db->insert($table, $data, $escape);
		return $result;
	}
}